const filters = {
  getFileSize: size => {
      if (size < 1024) {
          size = size + 'B'
      } else if (size >= 1024 && size < 1024 * 1024) {
          size = parseFloat(size / 1024).toFixed(2) + 'KB'
      } else if (size >= 1024 * 1024) {
          size = parseFloat(size / (1024 * 1024)).toFixed(2) + 'MB'
      }
      return size
  },
  ecllipseFileName: name => {
    if (name && name.length > 25) {
        var newName = name.substring(0, 15) + '...'
        newName = newName + name.substring(name.length - 10, name.length)
        return newName
    } else {
        return name
    }
  }
}
export default filters
